<?php
	$title = 'title_'.$this->lang;
	$description = 'description_'.$this->lang;
	$author = 'author_'.$this->lang;
	$publisher = 'publisher_'.$this->lang;
?>
<div id="right-800">
	<div class="box-h1" id="books-info">
		<h1 title="Books info"><?=Kohana::lang('title.booksinfo')?></h1>
		<div class="box1">
			<div class="photo"><?=html::image(($product->photo_ext != '') ? 'photo/product/240/240/'.$product->id.'.'.$product->photo_ext : 'photo/product/240/240/nocover.jpg')?></div>
			<div class="info">
				<div class="detail">
					<h3><?=Kohana::lang('site.detail')?></h3><hr/>
					<table border="0">
					<?php if($product->series != '') { ?>
					<tr>
						<td width="100"><?=Kohana::lang('site.series')?></td>
						<td><?=$product->series?>&#160;&#160;&#160;&#160;<?=html::anchor('cart/addseries/'.$product->id, Kohana::lang('site.addseries'))?></td>
					</tr>
					<?php } ?>
					<tr>
						<td width="100"><?=Kohana::lang('site.author')?></td>
						<td><?=$product->$author?></td>
					</tr><tr>
						<td width="100"><?=Kohana::lang('site.publisher')?></td>
						<td><?=$product->$publisher?></td>
					</tr><tr>
						<td width="100">SKU</td>
						<td><?=$product->sku?></td>
					</tr><tr>
						<td width="100"><?=Kohana::lang('site.weight')?></td>
						<td><?=$product->weight?></td>
					</tr><tr>
						<td width="100"><?=Kohana::lang('site.price')?></td>
						<td>$<?=$product->price?></td>
					</tr></table>
				</div>
				<hr/>
				<div class="quantity">
					<table border="0"><tr>
						<td width="100"><h3><?=Kohana::lang('site.quantity')?>:</h3></td>
						<td><input id="quantity" type="text" value="1"/></td>
						<td>&#160;&#160;&#160;<a onclick="addToCart('<?=$product->id?>', '<?=$product->quantity?>');"><?=html::image('images/btn/addtocart.gif', array('align'=>'right'))?></a></td>
					</tr></table>
				</div>
			</div>
			<div class="desc"><h2><?=$product->$title?></h2><?=nl2br($product->$description)?></div>
		</div>
	</div>
	<div class="box-h1" id="books-related">
		<h1 title="Related Books"><?=Kohana::lang('title.relatedbooks')?></h1>
		<div class="box1">
			<ul class="book-list">
			<?php $i=1; foreach($related as $relate) { ?>
				<li>
					<?=html::anchor('bookstore/product/'.$relate->category_id.'/'.$relate->id, html::image(($relate->photo_ext != '') ? 'photo/product/120/120/'.$relate->id.'.'.$relate->photo_ext : 'photo/product/120/120/nocover.jpg'))?>
					<h3><?=html::anchor('bookstore/product/'.$relate->category_id.'/'.$relate->id, $relate->$title)?></h3>
					<h4>$<?=$relate->price?></h4>
				</li>
				<?php if( $i % 4 == 0 and $i != 8) { ?>
					</ul><hr/><ul class="book-list">
				<?php } ?>
			<?php $i++; } ?>
			</ul><p style="clear:both"></p>
		</div>
	</div>
</div>